package com.interactiveyang.meet;

import java.net.URLEncoder;

import android.app.Activity;
import android.content.Context;
import android.view.Window;
import android.view.WindowManager;
import android.widget.Toast;

public class C {
	
	public static class UserInfo{
		final public static String MEET_USERNAME_PREFTITLE = "username";
		final public static String MEET_PASSWORD_PREFTITLE = "password";
	}
	
	public static class OAuth {
		final protected static String	PREF_NAME				= "oauth";
		final protected static String	APP_NAME				= "meet";
		final protected static String	CONSUMER_KEY			= "interactiveyang.com";
		final protected static String	CONSUMER_SECRET			= "lI/YdjNZinX66SBY7hdij2Kc";
		final protected static String	CALLBACK_SCHEME			= "meet-android-app";
		final protected static String	CALLBACK_URL			= CALLBACK_SCHEME + "://latitude";
		final protected static String	SCOPE					= "https://www.googleapis.com/auth/latitude";
		final protected static String	GET_REQUEST_TOKEN_URL	= "https://www.google.com/accounts/OAuthGetRequestToken?scope=" + URLEncoder.encode(SCOPE)
																		+ "&xoauth_displayname=" + URLEncoder.encode(APP_NAME);
		final protected static String	GET_ACCESS_TOKEN_URL	= "https://www.google.com/accounts/OAuthGetAccessToken?scope=" + URLEncoder.encode(SCOPE);
		final protected static String	TOKEN_AUTHORIZATION_URL	= "https://www.google.com/latitude/apps/OAuthAuthorizeToken?domain=interactiveyang.com&location=all&granularity=best&hd=default";
	}
	
	public static class GLatitude{
		final protected static String API_KEY = "AIzaSyCEQFOU0eRPuu9qW9p4W1Yyw57ccpJhXF8";
		final protected static String GET_CURRENT_LOCATION = "https://www.googleapis.com/latitude/v1/currentLocation";
	}
	
	public static class MeetBack{
		
		public final static String USER_LOGIN = "http://meet.interactiveyang.com/androidbackend/meetlogin.php";
		public final static String GET_USER_INFO = "http://meet.interactiveyang.com/androidbackend/meetdb.php";
		public final static String SAVE_USER_CURRENT_LOCATION = "http://meet.interactiveyang.com/androidbackend/meetscl.php";
		public final static String POST_SHOUT = "http://meet.interactiveyang.com/androidbackend/meetpostshout.php";
		public final static String GET_SHOUT = "http://meet.interactiveyang.com/androidbackend/meetgetshout.php";
		public static BackendRequest backendRequest = new BackendRequest();
	}
	
	public static void setFullScreen(Activity a){
		a.requestWindowFeature(Window.FEATURE_NO_TITLE);
        a.getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, 
                WindowManager.LayoutParams.FLAG_FULLSCREEN );
	}
	
	public static void alert(Context c, String msg){
		Toast t = Toast.makeText(c, msg, Toast.LENGTH_SHORT);
		t.show();
	}
}
